Xbasic

CLIPBOARD.SET_DATA Function

Syntax

.Set_Data(B data[,N cb_type|C cb_typeName[,L reset]])

Arguments

data

The data to be stored.

cb_type|C

Optional. A number that specifies the type of data in the Clipboard. You may create new Clipboard_Format values with CLIPBOARD.REGISTER_TYPE(). Predefined values for Clipboard_Format are:

Format
Value
Text

1

DIB (Device Independent Bitmap)

8

DIF (Data Interchange Format)

5

SYLK

4

TIFF

6

reset

You can put multiple items of different types on the clipboard. For example, the clipboard could contain text data and a bitmap image. This flag determines whether to just clear the data the type currently being stored. Optional. Default = .T. (TRUE)

.T. = Clear all existing data types on the clipboard.
.F. = Only clear existing data type being stored.

Description

The CLIPBOARD.SET_DATA() method puts the data in the variable, Data on the clipboard. You can specify the type of data with the optional Clipboard_Format parameter. See CLIPBOARD.GET_DATA() for a list of standard clipboard formats. You can register a new Clipboard_Format value with the CLIPBOARD.REGISTER_TYPE() method.

Example

This script copies the address from the current record to the 'clipboard. The address is formatted as a standard address.

dim address as C
dim tbl as P
tbl = table.current()
address = trim(tbl.first_name) + " " + trim(tbl.last_name) + CRLF()
address = address + tbl.address_1 + CRLF()
if .not. tbl.address_2.is_blank()
    address = address + tbl.address_2 + CRLF()
end if
address = address + trim(tbl.city) + ", " + trim(tbl.state_prov) + " " + tbl.ZIP
:clipboard.set_data(address)

Limitations

Desktop applications only.

See Also